Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next

program fileNameHrefValue property

After struggling with the control for a few hours, I found a workaround.

First problem - the attachment links aren't generated properly for databases that are located in a subfolder of the DATA folder (the subfolder name is missing in the URL).
Workaround - to move database to the root.

Second problem - after resolving first issue, I found that any Word and Excel attachments don't open properly in IE. IE treats those attachments as html and opens in the browser with all data mixed with tags etc. PDF and jpegs were fine.
The same attachments work just fine if referenced the old way.

Here is an example of URL from Download control:
http://servername/path/db_with_xpage.nsf/xsp/.ibmmodres/domino/OpenAttachment/db_with_attachment.nsf/0FACE686E0BCD5A8C125732B002AA021/Body/John%20Doe.doc

and the old way:
http://servername/path/db_with_xpage.nsf/0/0FACE686E0BCD5A8C125732B002AA021/$FILE/John%20Doe.doc


The FileDownload control has two properties similar to the repeat control:
var and indexVar.
The first one (var) is a request scope attribute under which a row data is made available.
So basically it references the object that is repeated in the FileDownload control (FileRowData).

This FileRowData object has a property we can use - "getName()" which returns the file name.

So the fileNameHrefValue property can now be computed:

"0/" + dominoDocument1.getDocument().getUniversalID() + "/$FILE/" +rowData.getName()

where rowData is the variable name that was assigned for the FileDownload control var attribute.


<xp:fileDownload id="downloadOtherDocumentation" displayLastModified="false"
value="#{dominoDocument1.lnkOtherDocumentation}"
hideWhen="true" displayCreated="false"
allowDelete="true"
displaySize="true" displayType="false" var="rowData"
indexVar="rowIndex">
<xp:this.fileNameHrefValue><![CDATA[#{javascript:try{
return "0/" + dominoDocument1.getDocument().getUniversalID() + "/$FILE/" +rowData.getName()
}catch (e) {
}}]]>
</xp:this.fileNameHrefValue>
</xp:fileDownload>


It solves both problems, but has some limitations - doesn't allow to have two files with the same name.
Hope this helps.
Irina


Feedback response number WEBB7R6T9V created by ~Vanessa Zeknuzennivu on 04/16/2009

File download from another database... (~Richard Dwojip... 10.Feb.09)
. . Saw this error in the Discussion Da... (~Joseph Cisgero... 10.Feb.09)
. . program fileNameHrefValue property (~Vanessa Zeknuz... 16.Apr.09)
. . Investigating... (~Joan Zektoomar... 11.Feb.09)
. . . . Any news about your investigation? (~Ted Xanjumilyo... 7.May.09)
. . Worked for me, or am I missing some... (~Joan Zektoomar... 11.Feb.09)
. . . . Repeated your test without success (~Richard Dwojip... 13.Feb.09)
. . . . . . The same file link error (~Ted Xanjumilyo... 8.Mar.09)
. . . . . . . . Server crashes (~Ted Xanjumilyo... 9.Mar.09)
. . . . . . . . . . Are you using XPages? (~Fritz Kifoober... 12.Mar.09)
. . . . . . . . . . . . Yes - we are using XPages (~Ted Xanjumilyo... 19.Mar.09)
. . . . . . . . . . . . . . Same problem here (~Wendy Fezfanam... 26.Mar.09)
. . . . . . . . . . . . . . . . Any news about your investigation, ... (~Ted Xanjumilyo... 1.Apr.09)
. . . . . . . . . . . . . . . . . . Same problem with File Download ico... (~Pippy Elavitch... 24.Sep.09)
. . . . . . . . . . . . . . . . . . . . is it a bug? (~Pippy Elavitch... 24.Sep.09)
. . . . . . Any one solve this? (~Helga Desweman... 6.Sep.11)
. . . . . . . . Found a workaround (~Helga Desweman... 7.Sep.11)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS